From f79522aa34a8eeb2f37775019adada57a7c0ca7a Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 25 Apr 2007 07:40:00 +0000 Subject: [PATCH] debugging --- includes/IP.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/IP.php b/includes/IP.php index 51d92accb3..8a2756c9da 100644 --- a/includes/IP.php +++ b/includes/IP.php @@ -37,12 +37,18 @@ class IP { */ public static function isIPAddress( $ip ) { if ( !$ip ) return false; + if ( is_array( $ip ) ) { + throw new MWException( "invalid value passed to " . __METHOD__ ); + } // IPv6 IPs with two "::" strings are ambiguous and thus invalid return preg_match( '/^' . IP_ADDRESS_STRING . '$/', $ip) && ( substr_count($ip, '::') < 2 ); } public static function isIPv6( $ip ) { if ( !$ip ) return false; + if( is_array( $ip ) ) { + throw new MWException( "invalid value passed to " . __METHOD__ ); + } // IPv6 IPs with two "::" strings are ambiguous and thus invalid return preg_match( '/^' . RE_IPV6_ADD . '(\/' . RE_IPV6_PREFIX . '|)$/', $ip) && ( substr_count($ip, '::') < 2); } -- 2.20.1